package com.sanyuancloud.springai.hello.controller;

import jakarta.annotation.Resource;
import org.springframework.ai.openai.OpenAiChatModel;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("ai/deepseek/v1")
@RestController
public class DeepseekV1Controller {

    @Resource
    private OpenAiChatModel chatModel;


    @GetMapping("/chat")
    public String chat(@RequestParam("prompt") String prompt) {
        String string = chatModel.call(prompt);
        return string;
    }
}
